<?php
/********************************
 *                              *
 * 路由配置文件                 *
 *                              *
 * ******************************
 */
use Phalcon\Mvc\Router\Group as RouterGroup;

$frontend = new RouterGroup([
    'module' => 'frontend',
    'controller' => 'index',
    'action' => 'index'
]);

$strpost = strstr($_SERVER['HTTP_HOST'], 'www');
$host = $strpost != null && $strpost != '' ? 'www.' . HOST : HOST;

$frontend = $frontend->setHostname($host);

$frontend->add('/', [
    'action' => 'index'
])->setName('index');


$frontend->add('/:controller', [
    'controller' => 1,
    'action' => 'index'
]);
$frontend->add('/:controller/:action', [
    'controller' => 1,
    'action' => 2
]);

$router->mount($frontend);
?>